// path 内置模块
const path = require("path");

// 1.path.resolve()：获取路径的绝对地址，可以帮你处理和拼接多个路径
// let myurl = "./test";
// let res = path.resolve(myurl);
// let res = path.resolve(myurl, "./index/mydir", "../testindex");
// console.log(res);

// 2.path.join():处理拼接路径
// let res = path.join("./index.js", "../mydir/mytest", "./index.html");
// console.log(res);

// 3.获取路径中的目录地址path.dirname
// let myurl = "http://localhost/index/test/index.html";
// let res = path.dirname(myurl)
// console.log(res);

// 4.path.extname获取地址中的文件后缀名
let myurl = "http://localhost/index/test/index.html";
let res = path.extname(myurl)
console.log(res);